<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Item</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
    <div th:replace="common/top"></div>

    <div id="Content">
        <div id="BackLink">
            <a th:href="@{/catalog/viewProduct?productId={productId}(productId=${session.item.productId})}" th:text="|Return to ${session.item.productId}|">Return to Product</a>
        </div>

        <div id="Catalog">

            <table>
                <tr>
                    <td>
                        <img th:src="${session.product.image}">
                        <p th:text="${session.product.description}">This is description</p>
                    </td>
                </tr>
                <tr>
                    <td><b th:text="${session.item.itemId}"> This is itemId </b></td>
                </tr>
                <tr>
                    <td>
                        <b>
                            <font size="4" th:text="|${session.item.attribute1} ${session.product.name}|">
                                This is attrs
                            </font>
                        </b>
                    </td>
                </tr>
                <tr>
                    <td th:text="${session.product.name}">This is product name</td>
                </tr>
                <tr>
                    <td th:if="${session.item.quantity <= 0}">
                        Back ordered.
                    </td>
                    <td th:if="${session.item.quantity > 0}" th:text="|${session.item.quantity} in stock|">
                    </td>
                </tr>
                <tr>
                    <td th:text="'$'+${#numbers.formatDecimal(session.item.listPrice,0,'COMMA',2,'POINT')}"></td>
                </tr>

                <tr>
                    <td>
                        <a class="Button" th:href="@{/cart/addItemToCart?itemId={itemId}(itemId=${session.item.itemId})}">Add to Cart</a>
                    </td>
                </tr>
            </table>
        </div>

        <div th:replace="common/bottom"></div>
    </div>
</body>
</html>